home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / MSDOS / (m)aac / NYWHELP.16 < prev    next >
Text File  |  1986-08-02  |  2KB  |  46 lines

  1.                    SEARCH AND SUBSTITUTION COMMANDS
  2.  
  3. <+SEARCH> searches from the cursor position forwards for the specified
  4. pattern.
  5. <-SEARCH>   searches  backwards  from  the  cursor  position  for  the
  6. specified pattern.
  7.     For the two commands above, you are allowed  to  put  any  regular
  8. expression  as  a  pattern.  You  are  then asked if you would like to
  9. ignore the case of the letters  when  searching.  Regular  expressions
  10. consist of the following metacharacters :
  11.   ^  matches the beginning of a line
  12.   $  matches the end of a line
  13.   ?  matches any character
  14.   *  matches 0 or more occurences of the previous pattern
  15.   [] character class
  16.  
  17. When you invoke these commands, you will be given the previous pattern
  18. you typed in as a default. If you press <RETURN>, that pattern will be
  19. used again. (If the previous pattern shown to you ends with a '!',  it
  20. means that you wanted to ignore the case.)
  21.  
  22. <+SUBST>  searches from the cursor position forwards for the specified
  23. pattern, and for  each  occurence  of  the  pattern,  substitutes  the
  24. replacement string.
  25. <-SUBST> searches backwards from the cursor position, then substitutes
  26. the replacement string.
  27.     The replacement string can have the metacharacter '&', which means
  28. to  substitute  the  matched  pattern  as part of the replacement. For
  29. instance, if your pattern to search for was 'cat', and the replacement
  30. string is 'alley&', then the word 'alleycat' will be replaced for each
  31. occurence of 'cat'.
  32.     You  are  asked  if  you want to approve each substitution. If you
  33. reply 'n', then the replacements will be made globally from the cursor
  34. position to the end (or beginning) of the file. If you reply 'y', then
  35. when the pattern is found you are asked if you  want  to  replace  it,
  36. ignore it, or stop the substitution operation totally.
  37.  
  38. <GLOBALSUB>  allows  you  to  perform  multiple  substituions at once.
  39. When you use this command, the screen clears, and you are given a  new
  40. buffer  in  which  to enter your substitution patterns. Each line that
  41. you type must be of the form :
  42.      pattern=replacement
  43. where the pattern can  be  any  regular  expression.  After  you  have
  44. finished  typing  all of the substitution patterns, press <CTRL D> and
  45. the substitution operation will begin.
  46.